<template>
    <div class="debris-list" v-loading="loading">
        <div class="table-box">
            <el-table :data="tableData" ref="table" border style="width: 100%">
                <el-table-column min-width="120" label="段位类型" prop="jobLevel"></el-table-column>
                <el-table-column min-width="120" label="对局数" prop="playNumber"></el-table-column>
                <el-table-column min-width="120" label="胜利局" prop="winNumber"></el-table-column>
                <el-table-column min-width="120" label="胜率" prop="winRate"></el-table-column>
            </el-table>
        </div>
    </div>
</template>

<script>

export default {
    name: 'getEvaluate',
    props: {
        tabIndex: ''
    },
    data () {
        return {
            tableData: [],
            loading: false
        }
    },
    watch: {
        tabIndex (value) {
            if (value === '5') {
                this.getList()
            }
        }
    },
    methods: {
        // 获取列表
        async getList () {
            if (this.loading) return
            this.loading = true
            let params = {
                userId: this.$route.query.userId
            }
            let res = await this.$http.get('/user/userWinRate', { params })
            if (res.code === '0') {
                this.tableData = res.data && res.data.list
            } else {
                this.$message({
                    type: 'error',
                    message: '系统异常，请稍后再试'
                })
            }
            this.loading = false
        }
    }
}
</script>

<style lang="scss" scoped>
    .debris-list {
        .input-box {
            margin-top: 10px;
            font-size: 13px;
            font-weight: 500;
            .input-title {
                margin: 0 10px 0 20px;
            }
            .btn {
                margin-top: 10px;
                margin-left: 10px;
            }
        }

        .table-box {
            margin: 20px 0;
            .cover {
                width: 80px;
                height: 80px;
                > img {
                    width: 100%;
                    height: 100%;
                }
            }
            .user-icon {
                width: 20px;
                height: 20px;
                border-radius: 50%;
                margin-right: 5px;
                vertical-align: top;
            }
            .table-btn {
                cursor: pointer;
                color: #409EFF;
                font-size: 13px;
                font-weight: 500;
                &:hover {
                    text-decoration: underline;
                }
            }
        }
    }
</style>
